/*
 * @name: 
 * @Author: 刘大可
 * @Date: 2025-01-05 17:03:55
 * @LastEditors: 刘大可
 * @LastEditTime: 2025-01-14 02:23:51
 */
import date from "./tools/date"
// import request from "@/utils/request.js";
console.log(request);
import request from "./tools/http";
import tips from "./tools/tips"
module.exports = {
    install(app){
        app.prototype.middle = {
            ...date,
            ...request,
            ...tips,
            go(url){
                uni.navigateTo({
                    url,
                    fail: function (err)
                    {
                        console.log(err)
                    }
                })
            },
            back(){
                uni.navigateBack({
                    delta: 1
                })
            },
            fd(urls = [], current = 0) {
                uni.previewImage({
                    current,
                    urls
                })
            },
            
        }
    }
}
// Vue.prototype.go = function (url, isLogin = false) {
//     if (isLogin && !uni.getStorageSync("token")) {
//         this.middle.tips("请先登录").then(res => {
//             uni.navigateTo({ url: "/uni_modules/kb-public/pages/login" })
//         })
//         return
//     }
//     uni.navigateTo({
//         url,
//         fail: function (err) {
//             console.log(err)
//         }
//     })
// }